<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../print.css" type="text/css" media="print">
<meta content="StateEngine,com.flashsim.FStEng.Three.StateEngine,ACTIVATE,DEACTIVATE,UNHANDLED_EVENT,activeStates,name,active,topState,activate,deactivate,postEvent,prepareNetwork,removeStateEngine,setStateNetwork" name="keywords">
<title>com.flashsim.FStEng.Three.StateEngine</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'StateEngine - API Documentation';
				var baseRef = '../../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">Flash State Engine, version 3.0</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../index-list.html')" href="../../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../../index.html?com/flashsim/FStEng/Three/StateEngine.html&amp;com/flashsim/FStEng/Three/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;StateEngine</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a>&nbsp;| <a href="#constantSummary">Constants</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class StateEngine"); titleBar_setSubNav(true,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">com.flashsim.FStEng.Three</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class StateEngine</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">StateEngine <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../../../images/inherit-arrow.gif"> flash.events.EventDispatcher</td>
</tr>
</table>
<p></p>
  The StateEngine is the main data structure for the hierarchical state machine.
  <p>The StateEngine encapsulates the functionality for a state machine (hierarchical or finite states).
  Once you create an instance of a StateEngine, you then instantiate the state network as a series of
  State's (simple states), HState's (hierarchical states), and HStateC's (Hierarchical, concurrent states).</p>
  <p>To keep track of the current state(s), a data structure called a <code>StateManager</code> is used.  A State Manager
  keeps track of which state(s) in a network is/are current.  Trying to avoid confusion, the API hides this as
  much as possible by automatically creating State Managers when the developer uses State's and HState's, for example, via <code>stateInstance.addSubState()</code> and
  <code>stateInstance.addSubHState()</code>.  However, since
  a State Manager is required to manage each sub-network, if the developer creates an HStateC, he must manually create
  State Manager's to organize the HStateC's sub-networks.</p>
  <p>To activate the state network, use <code>active = true;</code>, or <code>activate()</code>.  To send events
  into the StateEngine, use <code>PostEvent()</code>.  Events can optionally be postponed by passing in a delay value, but there
  currently is no mechanism to defer events (as in UML 2.0).  Events are processed in a FIFO, priority-based queue (default priority is 1000:
  lower number means higher priority).  The engine guarantees
  that the network runs-to-completion before processing the next event in the queue.</p>
  <p>If you only want a finite state machine, you can create a top state as a hierarchical
  state (HState) and then just add simple states (State) to the network.</p>
  
  
  <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#active">active</a> : Boolean<div class="summaryTableDescription">
   Flag indicating if state engine is active.</div>
</td><td class="summaryTableOwnerCol">StateEngine</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#activeStates">activeStates</a> : Dictionary<div class="summaryTableDescription">
   A Dictionary (flash.utils.Dictionary) of the currently active states.</div>
</td><td class="summaryTableOwnerCol">StateEngine</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#name">name</a> : String<div class="summaryTableDescription">
   User-defined (String) name of the state engine.</div>
</td><td class="summaryTableOwnerCol">StateEngine</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#topState">topState</a> : <a href="../Three/HStateC.html">HStateC</a>
<div class="summaryTableDescription">
  Topmost state in the state network.</div>
</td><td class="summaryTableOwnerCol">StateEngine</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#StateEngine()">StateEngine</a>(n:String = "State Engine", stateNetwork:<a href="HStateC.html">HStateC</a> = null)</div>
<div class="summaryTableDescription">
   Creates a new instance of a state engine data structure.</div>
</td><td class="summaryTableOwnerCol">StateEngine</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#activate()">activate</a>(resetHistory:Boolean = true):void</div>
<div class="summaryTableDescription">
  Activates the state engine.</div>
</td><td class="summaryTableOwnerCol">StateEngine</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#deactivate()">deactivate</a>():void</div>
<div class="summaryTableDescription">
  Deactivate the state engine.</div>
</td><td class="summaryTableOwnerCol">StateEngine</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#postEvent()">postEvent</a>(ev:Event, timeDelay:Number = 0, pty:int = 1000):void</div>
<div class="summaryTableDescription">
   Main routine for injecting an event into the state network.</div>
</td><td class="summaryTableOwnerCol">StateEngine</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#prepareNetwork()">prepareNetwork</a>():void</div>
<div class="summaryTableDescription">
   Initializes the states and transitions before the engine activates the first time.</div>
</td><td class="summaryTableOwnerCol">StateEngine</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#removeStateEngine()">removeStateEngine</a>():void</div>
<div class="summaryTableDescription">
  Removes memory associated with the state engine passed in.</div>
</td><td class="summaryTableOwnerCol">StateEngine</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#setStateNetwork()">setStateNetwork</a>(sn:<a href="HStateC.html">HStateC</a>, suppressReassign:Boolean = false):void</div>
<div class="summaryTableDescription">
  Attaches the state network (referred to by topmost state) to this state engine.</div>
</td><td class="summaryTableOwnerCol">StateEngine</td>
</tr>
</table>
</div>
<a name="constantSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Constants</div>
<table id="summaryTableConstant" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Constant</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#ACTIVATE">ACTIVATE</a> : String = "ACTIVATE"<div class="summaryTableDescription">[static]
   Event sent when the state engine gets activated.</div>
</td><td class="summaryTableOwnerCol">StateEngine</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#DEACTIVATE">DEACTIVATE</a> : String = "DEACTIVATE"<div class="summaryTableDescription">[static]
   Event sent when the state engine gets deactivated.</div>
</td><td class="summaryTableOwnerCol">StateEngine</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#UNHANDLED_EVENT">UNHANDLED_EVENT</a> : String = "UNHANDLED"<div class="summaryTableDescription">[static]
   Event sent when no state has handled an injected event.</div>
</td><td class="summaryTableOwnerCol">StateEngine</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="active"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">active</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>active:Boolean</code>&nbsp;&nbsp;[read-write]<p>
   Flag indicating if state engine is active.
   </p><p>Setting this flag to true will activate the engine.  Setting it to false will deactive the engine.  Retrieving
   the value will tell you if the state engine is active or not.
   <p>The default value is <code>false</code>.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get active():Boolean</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set active(value:Boolean):void</code>
<br>
</div>
<a name="activeStates"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">activeStates</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var activeStates:Dictionary</code><p>
   A Dictionary (flash.utils.Dictionary) of the currently active states.
   </p><p>The State objects are keys, with values being <code>true</code></p>.
   </div>
<a name="name"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">name</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var name:String</code><p>
   User-defined (String) name of the state engine.
   </p><p>The default value is <code>"State Engine"</code>.</p>
</div>
<a name="topState"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">topState</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>topState:<a href="../Three/HStateC.html">HStateC</a></code>&nbsp;&nbsp;[read-write]<p>
  Topmost state in the state network.
  Set and retrieve the topmost state (HState, HStateC) in the state network.  The top state can be a State, but that would
  be a pretty boring state machine.  If you want the top state to be a State, you can cast your State into an HStateC and pass
  it in, since HStateC is a sub-state of State.
  
  You can set this parameter as an alternative to supplying the top state's pointer in the StateEngine constructor.
  </p><p>The default value is <code>null</code>.</p>
<span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get topState():<a href="../Three/HStateC.html">HStateC</a></code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set topState(value:<a href="../Three/HStateC.html">HStateC</a>):void</code>
<br>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="StateEngine()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">StateEngine</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function StateEngine(n:String = "State Engine", stateNetwork:<a href="HStateC.html">HStateC</a> = null)</code><p>
   Creates a new instance of a state engine data structure.
   </p><p>This is the constructor.  Make sure to hold onto the pointer to this somewhere safe (i.e., away from
   the possibility that it will be garbage-collected).  For example, you typically will set the return value
   to a property of an class instance in your application.  If you do not hold onto this, Flash may mark
   the instance for garbage collection and your network could start acting strange.</p>
   
   <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">n</span>:String</code> (default = "<code>State Engine</code>")<code></code> &mdash;    Optional name (String) for the state engine.  Default is "State Engine".
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">stateNetwork</span>:<a href="HStateC.html">HStateC</a></code> (default = <code>null</code>)<code></code> &mdash;  Optional top state (HState, HStateC, or State [under rare circumstances]) of the network.
         A top state is mandatory, but supplying it in the constructor is optional.  If you don't
         supply it here, you must use <code>setStateNetwork()</code> and pass in the top state.
   </td>
</tr>
</table>
<br>
<span class="label">Example</span>
<br><div class='listing'><pre>  // this includes top state in instantiation<br>
   se = new StateEngine("engine1", new HState("TOP CONTAINER STATE", 0));</pre></div>
   <p></p><div class='listing'><pre>// this assumes top state pointer will be supplied via setStateNetwork()<br>
   se = new StateEngine("engine1");</pre></div>
  <p></p>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="activate()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">activate</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function activate(resetHistory:Boolean = true):void</code><p>
  Activates the state engine.
  </p><p>Typically you will use the <code>active</code> property to activate <code>active = true;</code> your state engine.  However,
  you can use this method all the same.  When an engine is activated, it combs through the state network and
  clears all the history markers by default.  If you don't want this to happen, you cannot use <code>active</code>, you
  must use this routine and set the 'resetHistory' parameter to <code>false</code>.</p>
  <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">resetHistory</span>:Boolean</code> (default = <code>true</code>)<code></code> &mdash; (optional) Set this to 'false' if you do not want to reset the history mechanism throughout the system.  Default is true.
  </td>
</tr>
</table>
</div>
<a name="deactivate()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">deactivate</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function deactivate():void</code><p>
  Deactivate the state engine.
  </p><p>Typically you will use the <code>active</code> property to deactivate <code>active = false;</code> your state engine.
  </div>
<a name="postEvent()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">postEvent</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function postEvent(ev:Event, timeDelay:Number = 0, pty:int = 1000):void</code><p>
   Main routine for injecting an event into the state network.
   </p><p>The state engine sits in the current state(s) and basically waits until some event comes in.  This method
   is how you inject an event into the network.  When you pass in an event, this routine sends the event to
   the active state(s) in the network.  If that/those state(s) don't handle it, the event bubbles up to the
   parent to take a shot at handling the event, and so on, up to the topmost state. If no state handles the event,
   the state engine generates a special event, <code>StateEngine.UNHANDLED_EVENT</code>, which you can subscribe to.  In
   that way, the caller can tell if any state handled the event or not.</p>
   <p>Events are Priority FIFO-queued.  The engine guarantees run-to-completion by verifying no event is currently being handled
   when the engine injects the event.  If a new event comes in while one is already being handled, the event gets queued.</p>
   <p>Callers may indicate to postpone an event for a set amount of time (in milliseconds).  This might be useful, for example, if you need to space
   out the time a bit due to Flash needing a moment to get to the next frame.</p>
   <p>Events can be assigned priorities, so that higher-priority (lower number) events can jump in line in front of lower-priority
   events.  However, because run-to-completion must be observed, there is no way to interrupt an event being handled currently
   even with a higher-priority event.</p>
  <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">ev</span>:Event</code> &mdash; Event object (pointer)
  </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">timeDelay</span>:Number</code> (default = <code>0</code>)<code></code> &mdash; Amount of time (in milliseconds) to wait after finishing handling the prior event, and when this event gets processed.  Default value is 0 (immediately).
  </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">pty</span>:int</code> (default = <code>1000</code>)<code></code> &mdash; Integer indicating the priority of the event.  By default, all events are given a priority of 1000.
  </td>
</tr>
</table>
</div>
<a name="prepareNetwork()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">prepareNetwork</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function prepareNetwork():void</code><p>
   Initializes the states and transitions before the engine activates the first time.
   </p><p>The State Engine must do two things before activating:</p><ol>
   <li>Place a state engine pointer in each state (since State's are not related to the State Engine, but States need access)
   <li>Pre-compute the paths of transitions, to make their execution as efficient as possible.
   </ol>
   <p>This routine accomplishes both tasks.  If the developer wants to avoid the time it takes to perform these
   when the engine activates the first time, he should call this routine.  Once complete, the developer would activate the engine.
   If the developer does not call this routine, the engine activation will call it automatically.</p>
   </div>
<a name="removeStateEngine()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">removeStateEngine</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function removeStateEngine():void</code><p>
  Removes memory associated with the state engine passed in.
  </p></div>
<a name="setStateNetwork()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">setStateNetwork</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function setStateNetwork(sn:<a href="HStateC.html">HStateC</a>, suppressReassign:Boolean = false):void</code><p>
  Attaches the state network (referred to by topmost state) to this state engine.
  You can use this method as an alternative to supplying the top state's pointer in the StateEngine constructor.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">sn</span>:<a href="HStateC.html">HStateC</a></code> &mdash;  Pointer to topmost state (virtually always HState or HStateC, if you need it to be State, cast your State into an HStateC) for the state network.
  </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">suppressReassign</span>:Boolean</code> (default = <code>false</code>)<code></code> &mdash; Optional parameter that locks out possibility to change the top state, once it has been assigned. If an
  attempt is made to change the name, the routine throws an Error.
  </td>
</tr>
</table>
<br>
<span class="label">Example</span>
<br><div class='listing'><pre>myTopStatePtr = new HState("State Network", 0);<br>se.setStateNetwork(myTopStatePtr);</pre></div>
  <p></p>
</div>
<a name="constantDetail"></a>
<div class="detailSectionHeader">Constant detail</div>
<a name="ACTIVATE"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">ACTIVATE</td><td class="detailHeaderType">constant</td>
</tr>
</table>
<div class="detailBody">
<code>public static const ACTIVATE:String = "ACTIVATE"</code><p>
   Event sent when the state engine gets activated.
   </p></div>
<a name="DEACTIVATE"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">DEACTIVATE</td><td class="detailHeaderType">constant</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static const DEACTIVATE:String = "DEACTIVATE"</code><p>
   Event sent when the state engine gets deactivated.
   </p></div>
<a name="UNHANDLED_EVENT"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">UNHANDLED_EVENT</td><td class="detailHeaderType">constant</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static const UNHANDLED_EVENT:String = "UNHANDLED"</code><p>
   Event sent when no state has handled an injected event.
   </p><p>If an event is posted but no state has an event handler to handle it.  To help the handler recognize which event went
   unhandled, the StateEngine has an <code>event</code> property that hangs off of the EventWithData's data object.  For example,
   <code>myEventWithDataPtr.data.event</code> gives the Event object that went unhandled.  The default handler can examine
   that event and decide what the default behavior needs to be.</p>
   </div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
